package com.cxs.musicplaywidget.player.player;

import com.cxs.musicplaywidget.util.LogUtils;
import ohos.media.player.Player;

/**
 * @ClassName IPlayerListener
 * @Author cxs
 * @Version 1.0
 * @Description TODO
 * @Date 2022/03/21
 */
public interface IPlayerListener extends Player.IPlayerCallback {
        String tag = IPlayerListener.class.getSimpleName();
        @Override
        default void onPrepared() {
                LogUtils.debug(tag, "onPrepared()");
        }

        @Override
        default void onMessage(int i, int i1){
                LogUtils.debug(tag, "onMessage():i=" + i + ", i1="+ i1);
        }

        @Override
        default void onError(int i, int i1){
                LogUtils.debug(tag, "onError():i=" + i + ", i1="+ i1);
        }

        @Override
        default void onResolutionChanged(int i, int i1){}

        @Override
        default void onPlayBackComplete() {
                LogUtils.debug(tag, "onPlayBackComplete()");
        }

        @Override
        default void onRewindToComplete(){}

        @Override
        default void onBufferingChange(int i){
                LogUtils.debug(tag, "onBufferingChange() " + i);
        }

        @Override
        default void onNewTimedMetaData(Player.MediaTimedMetaData mediaTimedMetaData){
                LogUtils.debug(tag, "mediaTimedMetaData() " + mediaTimedMetaData.timestampUs);
        }

        @Override
        default void onMediaTimeIncontinuity(Player.MediaTimeInfo mediaTimeInfo){}
}
